package com.example.zsfinacialmanage.other;

import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.zsfinacialmanage.R;
import com.example.zsfinacialmanage.activity.SysSettingActivity;
import com.example.zsfinacialmanage.constant.MessageConstant;
import org.apache.commons.lang3.RandomStringUtils;

public class AboutUsActivity extends AppCompatActivity {

    private Button btn_back,btn_download,btn_code;
    private TextView txt_xmsm,txt_version;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);

        btn_back = findViewById(R.id.bt_back_ab);
        btn_download = findViewById(R.id.bt_download_ab);
        txt_xmsm = findViewById(R.id.txt_xmsm_ab);
        txt_version = findViewById(R.id.txt_version_ab);
        btn_code = findViewById(R.id.bt_code_ab);

        txt_xmsm.setText(MessageConstant.PROJECT_DESCRIPTION);
        txt_version.setText(MessageConstant.VERSION_NUMBER);

        btn_code.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // 创建一个意图（Intent）
                Intent intent = new Intent(Intent.ACTION_VIEW);
                // 设置意图的URI为要跳转的网址
                intent.setData(Uri.parse("https://gitee.com/to-DiTing/wealth-management-connect-app"));
                // 启动意图，跳转到指定的网址
                startActivity(intent);
            }
        });

        btn_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(AboutUsActivity.this, SysSettingActivity.class);
                startActivity(intent);
                finish();
            }
        });

        btn_download.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // 创建一个意图（Intent）
                Intent intent = new Intent(Intent.ACTION_VIEW);
                // 设置意图的URI为要跳转的网址
                intent.setData(Uri.parse("https://pan.baidu.com/s/164TEmw3l6NN3C7bcn6ER7g?pwd=0224"));
                // 启动意图，跳转到指定的网址
                startActivity(intent);
            }
        });

    }
}